package edu.pku.sei.gefcommon.common.resourceManager;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

public class ImageManager extends ResourceManager<String,Image> {
	public ImageManager(){
		super();
	}
	public void init(){
		
	}
	public void registImage(String id,Image img){
		set(id,img);
	}
	public void registImage(String id,String uri){
		if(isContain(id)) return;	//loading image from file is a heavy work,
									//so we'd better to avoid unnecessary loading.
		Image img = new Image(Display.getCurrent(),uri);
		set(id,img);
	}
}
